import sys

from PyQt5.QtWidgets import QApplication

from protolib import remove_empty_folders

from player.windows import MainWindow

from data import config

def main():
    """ Run the GUI and return the exit code """

    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()
    exit_code = app.exec()

    print('Clearing empty directories')
    remove_empty_folders(config['files']['audio']['path'])

    return exit_code
